package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.AutoFill;
import com.ruoyi.common.enums.AutoFillType;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.DispatchAlarmMapper;
import com.ruoyi.system.domain.DispatchAlarm;
import com.ruoyi.system.service.IDispatchAlarmService;

/**
 * 预警信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-02
 */
@Service
public class DispatchAlarmServiceImpl implements IDispatchAlarmService 
{
    @Autowired
    private DispatchAlarmMapper dispatchAlarmMapper;

    /**
     * 查询预警信息
     * 
     * @param alarmId 预警信息主键
     * @return 预警信息
     */
    @Override
    public DispatchAlarm selectDispatchAlarmByAlarmId(Long alarmId)
    {
        return dispatchAlarmMapper.selectDispatchAlarmByAlarmId(alarmId);
    }

    /**
     * 查询预警信息列表
     * 
     * @param dispatchAlarm 预警信息
     * @return 预警信息
     */
    @Override
    public List<DispatchAlarm> selectDispatchAlarmList(DispatchAlarm dispatchAlarm)
    {
        return dispatchAlarmMapper.selectDispatchAlarmList(dispatchAlarm);
    }

    /**
     * 新增预警信息
     * 
     * @param dispatchAlarm 预警信息
     * @return 结果
     */
    @AutoFill(operation = AutoFillType.INSERT)
    @Override
    public int insertDispatchAlarm(DispatchAlarm dispatchAlarm)
    {
        return dispatchAlarmMapper.insertDispatchAlarm(dispatchAlarm);
    }

    /**
     * 修改预警信息
     * 
     * @param dispatchAlarm 预警信息
     * @return 结果
     */
    @AutoFill(operation = AutoFillType.UPDATE)
    @Override
    public int updateDispatchAlarm(DispatchAlarm dispatchAlarm)
    {
        return dispatchAlarmMapper.updateDispatchAlarm(dispatchAlarm);
    }

    /**
     * 批量删除预警信息
     * 
     * @param alarmIds 需要删除的预警信息主键
     * @return 结果
     */
    @Override
    public int deleteDispatchAlarmByAlarmIds(Long[] alarmIds)
    {
        return dispatchAlarmMapper.deleteDispatchAlarmByAlarmIds(alarmIds);
    }

    /**
     * 删除预警信息信息
     * 
     * @param alarmId 预警信息主键
     * @return 结果
     */
    @Override
    public int deleteDispatchAlarmByAlarmId(Long alarmId)
    {
        return dispatchAlarmMapper.deleteDispatchAlarmByAlarmId(alarmId);
    }
}
